package com.woyou;

import java.util.HashMap;
import java.util.Map;

/**
 * 存放一些全局的常量
 * 
 * @author longtao.li
 *
 */
public class Constant {

	public static final int TYPE = 1; // 1: 运营服务器  2：捷玛服务器  3：我有服务器  4：压力服务器
	
	public static final String INFO_NAME = "info";
	
	//-------------app服务器---------------------------
	public static String SERVER_ADDRESS ="115.29.249.152"; //测试服务器IP
	public static String SJ_PORT = "200"; //捷码端口号
	public static String SERVER = "http://" + SERVER_ADDRESS + ":" + SJ_PORT + "/";//捷码服务器地址
	
	//-------------web服务器---------------------------
	public static String WEB_PORT = "118";
	public static String WEB_ADDRESS = "121.40.19.164"; //web页测试服务器
	public static String WEB_SERVER = WEB_ADDRESS + ":" + WEB_PORT;// web服务器

	public static final boolean DBG = true;

	public static final String DESCRIPTOR = "com.umeng.share";

	public static final int ALIPAY = 1;
	public static final int WEIXIN = 2;

	// 函数加密的密钥
	public static String IDELIVER_KEY = "woyouwaimaiapp";//捷码服务器密钥

	public static int currentVersion = 1;
	public static String versionName;

	public static String shoppingkey = "";

	// 城市代码：汕头市 0754 北京市 010 深圳市 0755 广州市 020 徐州市 0516 上海市 0021
	public static Map<String, String> CITY_CODE;

	static {
		CITY_CODE = new HashMap<String, String>();
		CITY_CODE.put("汕头", "0754");
		CITY_CODE.put("上海", "0021");
		CITY_CODE.put("北京", "010");
		CITY_CODE.put("深圳", "0755");
		CITY_CODE.put("徐州", "0516");
		CITY_CODE.put("广州", "020");
	}
	
	static {
		switch (TYPE) {
		case 1:
			//如果是发布版本  使用运营服务器和正式的key
			SERVER_ADDRESS = "phone.ideliver1.cn"; 
			SJ_PORT = "200";
			
			WEB_PORT = "80";
			WEB_ADDRESS = "webport.ideliver1.cn";
			
			IDELIVER_KEY = "WoYouPhone";
			break;
			
		case 2:
			// 捷玛服务器
			SERVER_ADDRESS ="115.29.249.152";  // IP
			SJ_PORT = "200"; //端口号
			
			WEB_PORT = "118";
			WEB_ADDRESS = "121.40.19.164";
			
			IDELIVER_KEY = "woyouwaimaiapp";
			break;
			
		case 3:
			// 我有服务器
			SERVER_ADDRESS ="dev-dev.php.ideliver2.cn"; // 我有服务器IP
			SJ_PORT = "80"; // 我有端口号
			
			WEB_PORT = "118";
			WEB_ADDRESS = "121.40.19.164";
			break;
			
		case 4:
			// 压力服务器
			SERVER_ADDRESS ="42.120.63.81"; // 压力测试服务器IP
			SJ_PORT = "200"; // 端口号
			
			WEB_PORT = "118";
			WEB_ADDRESS = "121.40.19.164";
			break;

		default:
			break;
		}
		
		SERVER = "http://" + SERVER_ADDRESS + ":" + SJ_PORT + "/"; //服务器地址
		WEB_SERVER = WEB_ADDRESS + ":" + WEB_PORT;// web服务器
		
	}
	

}
